package tom.shared;

import java.io.Serializable;
import java.sql.Date;
import com.google.gwt.view.client.ProvidesKey;

public class AppUser implements Serializable, Comparable<AppUser> {

	private static final long serialVersionUID = 3675668129722220776L;

	public static final ProvidesKey<AppUser> KEY_PROVIDER = new ProvidesKey<AppUser>() {
		public Object getKey(AppUser item) {
			return item == null ? null : item.getUserName();
		}
	};

	public AppUser() {
	}

	public AppUser(String userName, String fullName, String descript,
			Date created, String passwd, String comCode, Integer level) {
		this.setUserName(userName);
		this.setFullName(fullName);
		this.setDescript(descript);
		this.setCreated(created);
		this.setPasswd(passwd);
		this.setComCode(comCode);
		this.setLevel(level);
	}

	private String userName;
	private String fullName;
	private String descript;
	private Date created;
	private String passwd;
	private String comCode;
	private Integer level; 

	@Override
	public int compareTo(AppUser o) {
		return this.getUserName().compareTo(o.getUserName());
	}

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public String getFullName() {
		return fullName;
	}

	public void setFullName(String fullName) {
		this.fullName = fullName;
	}

	public String getDescript() {
		return descript;
	}

	public void setDescript(String descript) {
		this.descript = descript;
	}

	public Date getCreated() {
		return created;
	}

	public void setCreated(Date created) {
		this.created = created;
	}

	public String getPasswd() {
		return passwd;
	}

	public void setPasswd(String passwd) {
		this.passwd = passwd;
	}

	public String getComCode() {
		return comCode;
	}

	public void setComCode(String comCode) {
		this.comCode = comCode;
	}
	
	public Integer getLevel() {
		return level;
	}

	public void setLevel(Integer level) {
		this.level = level;
	}

}
